'use strict';
const db = uniCloud.database()
const collection = db.collection('houselist')
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	const data = {
		areaNum: event.areaNum,
		
		houseType: event.houseType,
		
		imgUrl: event.imgUrl,
		
		localName: event.localName,
		
		localType: event.localType,
		
		title: event.title,
		
		unitPrice: event.unitPrice,
		
		isLook: event.isLook
	}
	const res = await collection.add(data)
	//返回数据给客户端
	return res
};
